﻿//-----------------------------------------------------------------------
// <copyright file="Program.cs" company="CodePlex">
//     Copyright (c) Doug Holland, CodePlex. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace CodePlex.Diagnostics.Profiler.Console
{
    using System;

    using CodePlex.Diagnostics.Services;

    internal static class Program
    {
        private static void Main()
        {
            DiagnosticsServiceHost.StartService();

            try
            {
                for (int index = 0; index < 10; index++)
                {
                    index /= index;
                }
            }
            catch (DivideByZeroException ex)
            {
                DateTime start = DateTime.Now;

                ex.Publish();

                TimeSpan duration = DateTime.Now - start;

                Console.WriteLine(duration.ToString());
            }

            Console.WriteLine("Press any key to stop the WCF service...");
            Console.ReadKey();

            DiagnosticsServiceHost.StopService();
        }
    }
}
